{extend name="base" /}
{block name="main"}
<div class="tpl-content-wrapper">
    <div class="tpl-content-page-title">
        用户列表
    </div>
    <ol class="am-breadcrumb">
        <li><a href="#" class="am-icon-home">首页</a></li>
        <li><a href="#">用户管理</a></li>
        <li class="am-active">用户列表</li>
    </ol>
    <div class="tpl-portlet-components">
        <div class="portlet-title">
            <div class="caption font-green bold">
                <span class="am-icon-code"></span> 列表
            </div>
            <div class="tpl-portlet-input tpl-fz-ml">
                <div class="portlet-input input-small input-inline">
                    <div class="input-icon right">
                        <i class="am-icon-search"></i>
                        <input type="text" class="form-control form-control-solid" id="findtel" placeholder="输入tel查找用户"> </div>
                </div>
            </div>


        </div>
        <div class="tpl-block">
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">




                        </div>
                    </div>
                </div>


            </div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main am-table-centered">
                            <thead>
                            <tr>
                                <th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>
                                <th class="table-id">ID</th>
                                <th class="table-title">电话</th>
                                <th class="table-type">姓名</th>
                                <th class="table-date">身份证号</th>
                                <th class="table-date">实名状态</th>
                                <th class="table-date">余额</th>
                                <th class="table-date am-hide-sm-only">状态</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name='data' id='user'}
                            <tr>
                                <td><input type="checkbox"></td>
                                <td>{$user.id}</td>
                                <td>{$user.tel}</td>
                                <td>{$user.name}</td>
                                <td>{$user.idcard}</td>
                                <td class="am-hide-sm-only">{if $user.smstatus==1 || $user.smstatus==null}未实名{elseif $user.smstatus==3}已实名{else}认证中{/if}</td>
                                <td>{$user.money}</td>

                                {if $user.status==1}
                                <td class="am-hide-sm-only"><a class="u-status" u-status="{$user.status}" u-uid="{$user.id}">激活</a></td>
                                {else}
                                <td class="am-hide-sm-only"><a style="color: #93a2a9" class="u-status" u-status="{$user.status}" u-uid="{$user.id}">禁用</a></td>
                                {/if}

                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        <div class="am-cf">

                            <div class="am-fr">
                                    {$page}
                            </div>
                        </div>
                        <hr>

                    </form>
                </div>

            </div>
        </div>
        <div class="tpl-alert"></div>
    </div>


</div>

<script>
    $(function(){
       var $ustu = $('.u-status');
       $ustu.click(function(){
           var uid = $(this).attr('u-uid');
           var stu = $(this).attr('u-status');
           var obj = $(this);
//           console.log(stu);
           csajax(uid,stu,obj,'/admin/User/changestatus');
       });

        $('.am-icon-search').click(function () {
            var tel = $('#findtel').val();
//            alert('admin/User/'+tel);
            window.location.href = '/admin/User/'+tel;
        })



    });



</script>


{/block}